<?xml version="1.0"?>
<!-- (C) 1998-2005 Watchfire Corporation   http://www.watchfire.com   -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:param name="watermarkImagePath"/>
  <xsl:param name="css"/>
  <xsl:param name="threatClassificationTitle"/>
  <xsl:param name="securityRiskTitle"/>
  <xsl:param name="causesTitle"/>
  <xsl:param name="technicalDescriptionTitle"/>
  <xsl:param name="cveTitle"/>
  <xsl:param name="referencesTitle"/>
  <xsl:param name="affectedProductsTitle"/>
  <xsl:param name="na"/>
  <xsl:param name="copyright"/>

  <xsl:template match="/">

    <HTML>

      <HEAD>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8" />
        <TITLE>AppScan</TITLE>
        <STYLE TYPE="text/css">
          <xsl:value-of select="$css"/>
        </STYLE>
      </HEAD>

      <BODY BGCOLOR="White" TOPMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0"
         MARGINHEIGHT="0" TEXT="#000000" background="{$watermarkImagePath}">
        <TABLE WIDTH="100%" CELLPADDING="3" CELLSPACING="0" BORDER="0" >
          <TR>
            <TD>
              <H2>
                <xsl:value-of select="/advisory/name"/>
              </H2>
              <BR/>

              <H3>
                <xsl:value-of select="/advisory/testDescription"/>
              </H3>
              <BR/>

              <H3>
                <xsl:value-of select="$threatClassificationTitle"/>
              </H3>
              <xsl:variable name="threatReference" select="/advisory/threatClassification/reference"/>
              <xsl:choose>
                <xsl:when test="$threatReference">
                  <h4>
                    <A TARGET="_new" HREF="{$threatReference}">
                      <xsl:apply-templates select="/advisory/threatClassification/name"/>
                    </A>
                  </h4>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="/advisory/threatClassification/name"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>

              <H3>
                <xsl:value-of select="$cveTitle"/>
              </H3>
              <xsl:variable name="cveLink" select="/advisory/cve/link" />
              
              <xsl:choose>
                <xsl:when test="$cveLink">
                  <UL>
                    <xsl:for-each select="/advisory/cve/link">
                      <LI>
                        <A TARGET="_new" HREF="{@target}">
                          <xsl:value-of select="."/>
                        </A>
                      </LI>
                    </xsl:for-each>
                  </UL>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="$na"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>
 
              <H3>
                <xsl:value-of select="$securityRiskTitle"/>
              </H3>
              <xsl:variable name="securityRisk" select="/advisory/securityRisks/securityRisk" />
              <xsl:choose>
                <xsl:when test="$securityRisk">
                  <UL>
                    <xsl:for-each select="$securityRisk">
                      <LI>
                        <xsl:value-of select="."/>
                      </LI>
                    </xsl:for-each>
                  </UL>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="$na"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>

              <H3>
                <xsl:value-of select="$causesTitle"/>
              </H3>
              <xsl:variable name="causes" select="/advisory/causes/cause" />
              <xsl:choose>
                <xsl:when test="$causes">
                  <UL>
                    <xsl:for-each select="$causes">
                      <LI>
                        <xsl:value-of select="."/>
                      </LI>
                    </xsl:for-each>
                  </UL>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="$na"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>

              <H3>
                <xsl:value-of select="$technicalDescriptionTitle"/>
              </H3>
              <xsl:variable name="technicalDescription" select="/advisory/testTechnicalDescription" />
              <xsl:choose>
                <xsl:when test="$technicalDescription">
                  <h4>
                    <xsl:apply-templates select="$technicalDescription"/>
                  </h4>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="$na"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>

              <H3>
                <xsl:value-of select="$affectedProductsTitle"/>
              </H3>
              <xsl:variable name="affectedProduct" select="/advisory/affectedProducts/affectedProduct" />
              <xsl:choose>
                <xsl:when test="$affectedProduct">
                  <UL>
                    <xsl:for-each select="$affectedProduct">
                      <LI>
                        <xsl:value-of select="."/>
                      </LI>
                    </xsl:for-each>
                  </UL>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="$na"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>

              <H3>
                <xsl:value-of select="$referencesTitle"/>
              </H3>
              <xsl:variable name="referencesText" select="/advisory/references/text" />
              <xsl:variable name="referencesLink" select="/advisory/references/link" />

              <xsl:if test="$referencesText">
                <H4>
                  <xsl:apply-templates select="$referencesText"/>
                </H4>
              </xsl:if>
              <xsl:choose>
                <xsl:when test="$referencesLink">
                  <UL>
                    <xsl:for-each select="/advisory/references/link">
                      <LI>
                        <A TARGET="_new" HREF="{@target}">
                          <xsl:value-of select="."/>
                        </A>
                      </LI>
                    </xsl:for-each>
                  </UL>
                </xsl:when>
                <xsl:otherwise>
                  <P>
                    <xsl:value-of select="$na"/>
                  </P>
                </xsl:otherwise>
              </xsl:choose>
              <BR/>
            </TD>
          </TR>
          <TR>
            <TD>
              <P>
                <FONT COLOR="#AAAAAA">
                  <xsl:value-of select="$copyright"/>
                  <A TARGET="_new" HREF="http://www.watchfire.com">
                    <FONT COLOR="#AAAAAA">
                      www.watchfire.com
                    </FONT>
                  </A>
                </FONT>
              </P>
            </TD>
          </TR>
        </TABLE>
      </BODY>
    </HTML>
  </xsl:template>

  <xsl:template match="br">
    <br/>
  </xsl:template>

  <xsl:template match="link">
    <A TARGET="_new" HREF="{@target}">
      <xsl:value-of select="."/>
    </A>
  </xsl:template>

  <xsl:template match="code">
    <PRE>
      <xsl:value-of select="." />
    </PRE>
  </xsl:template>

  <xsl:template match="indentText">
    <P class="indent">
      <xsl:value-of select="." />
    </P>
  </xsl:template>

</xsl:stylesheet>


